package listener;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;

public class SessionListener implements HttpSessionListener {

    @Override
    public void sessionCreated(HttpSessionEvent e) {

        System.out.printf("%s:监听到session创建,sessionId[%s]\n" ,this.getClass().getSimpleName(),e.getSession().getId());
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent e) {

        System.out.printf("%s:监听到session销毁,sessionId[%s]\n" ,this.getClass().getSimpleName(),e.getSession().getId());
    }
}